import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

export default new Router({
  // mode: 'history',
  routes: [
    {
      path: "/",
      redirect: "/survey",
    },
    {
      //这些路由模块名字自己改
      path: "/survey",
      redirect: "/survey/index",
      component: () => import("@/layout/index"),
      children: [
        {
          path: "test1",
          name: "survey.test",
          component: () => import("@/pages/survey/test1"),
        },
        {
          path: "test",
          name: "survey.test",
          component: () => import("@/pages/survey/test"),
        },
        {
          path: "index",
          name: "survey.index",
          component: () => import("@/pages/survey/index"),
        },
        {
          path: "setting",
          name: "setting.index",
          component: () => import("@/pages/survey/setting"),
        },
        {
          path: "attstatistics",
          name: "attstatistics.index",
          component: () => import("@/pages/survey/attstatistics"),
        },
        {
          path: "record",
          name: "record.index",
          component: () => import("@/pages/survey/record"),
        },
        {
          path: "details",
          name: "details.index",
          component: () => import("@/pages/survey/details"),
        },
      ],
    },
    {
      //这些路由模块名字自己改
      path: "/substitute",
      redirect: "/substitute/substituteApply",
      component: () => import("@/layout/index"),
      children: [
        {
          path: "substituteApply",
          name: "调代课申请",
          component: () => import("@/pages/substitute/substituteApply"),
        },
        {
          path: "substituteApproval",
          name: "调代课审批",
          component: () => import("@/pages/substitute/substituteApproval"),
        },
        {
          path: "substituteStatistics",
          name: "调代课统计",
          component: () => import("@/pages/substitute/substituteStatistics"),
        },
        {
          path: "substituteTeacherStatistics",
          name: "调代课统计(管理员)",
          component: () => import("@/pages/substitute/substituteTeacherStatistics"),
        },
        {
          path: "substituteSetting",
          name: "基础设置",
          component: () => import("@/pages/substitute/substituteSetting"),
        },
      ],
    },
    {
      path: "/leave",
      redirect: "/leave/leaveApple",
      component: () => import("@/layout/index"),
      children: [
        {
          path: "leaveApple",
          name: "请假申请",
          component: () => import("@/pages/leave/leaveApple"),
        },
        {
          path: "leaveApproval",
          name: "请假审批",
          component: () => import("@/pages/leave/leaveApproval"),
        },
        {
          path: "leaveSetting",
          name: "老师请假-基础设置",
          component: () => import("@/pages/leave/leaveSetting"),
        },
      ],
    },

    {
      path: "/rota",
      redirect: "/rota/index",
      component: () => import("@/layout/index"),
      children: [
        // 值班表
        {
          path: "index",
          name: "rota.index",
          component: () => import("@/pages/rota/index"),
        },
        // 值班区域
        {
          path: "arealist",
          name: "rota.arealist",
          component: () => import("@/pages/rota/arealist"),
        },
        // 值班统计
        {
          path: "statistics",
          name: "rota.statistics",
          component: () => import("@/pages/rota/statistics"),
        },
        // 日志
        {
          path: "log",
          name: "rota.log",
          component: () => import("@/pages/rota/log"),
        },
      ],
    },
    // 家访
    {
      path: "/homeVist",
      redirect: "/homeVist/index",
      component: () => import("@/layout/index"),
      children: [
        // 家访记录
        {
          path: "index",
          name: "homeVist.index",
          component: () => import("@/pages/homeVist/index"),
        },
        // 家访任务
        {
          path: "task",
          name: "homeVist.task",
          component: () => import("@/pages/homeVist/task"),
        },
        // 家访统计
        {
          path: "statistics",
          name: "homeVist.statistics",
          component: () => import("@/pages/homeVist/statistics"),
        },
      ],
    },
    // 选课
    {
      path: "/courseSelect",
      redirect: "/courseSelect/index",
      component: () => import("@/layout/index"),
      children: [
        // 选课管理
        {
          path: "index",
          name: "courseSelect.index",
          component: () => import("@/pages/courseSelect/index"),
        },
        // 成绩管理
        {
          path: "achievement",
          name: "courseSelect.achievement",
          component: () => import("@/pages/courseSelect/achievement"),
        },
        // 考勤管理
        {
          path: "attendance",
          name: "courseSelect.attendance",
          component: () => import("@/pages/courseSelect/attendance"),
        },
        // 我的课程
        {
          path: "course",
          name: "courseSelect.statistics",
          component: () => import("@/pages/courseSelect/course"),
        },
      ],
    },
  ],
});
